<?php

/**
 * Application Models
 *
 * @package Application_Model
 * @subpackage Model
 * @author <YOUR NAME HERE>
 * @copyright ZF model generator
 * @license http://framework.zend.com/license/new-bsd     New BSD License
 */

/**
 * Abstract class for models
 */
require_once 'ModelAbstract.php';

/**
 * 
 *
 * @package Application_Model
 * @subpackage Model
 * @author <YOUR NAME HERE>
 */
class Application_Model_Iconecls extends Application_Model_ModelAbstract
{

    /**
     * Database var type varchar(255)
     *
     * @var string
     */
    protected $_IdiconeCls;

    /**
     * Database var type varchar(512)
     *
     * @var string
     */
    protected $_LabelICone;

    /**
     * Database var type text
     *
     * @var text
     */
    protected $_Urlimage;



    /**
     * Dependent relation fk_actionsapplication_iconeCls1
     * Type: One-to-Many relationship
     *
     * @var Application_Model_Actionsapplication
     */
    protected $_Actionsapplication;

    /**
     * Dependent relation fk_services_iconeCls1
     * Type: One-to-Many relationship
     *
     * @var Application_Model_Services
     */
    protected $_Services;

    /**
     * Sets up column and relationship lists
     */
    public function __construct()
    {
        parent::init();
        $this->setColumnsList(array(
            'idiconeCls'=>'IdiconeCls',
            'LabelICone'=>'LabelICone',
            'urlimage'=>'Urlimage',
        ));

        $this->setParentList(array(
        ));

        $this->setDependentList(array(
            'FkActionsapplicationIconeCls1' => array(
                    'property' => 'Actionsapplication',
                    'table_name' => 'Actionsapplication',
                ),
            'FkServicesIconeCls1' => array(
                    'property' => 'Services',
                    'table_name' => 'Services',
                ),
        ));
    }

    /**
     * Sets column idiconeCls
     *
     * @param string $data
     * @return Application_Model_Iconecls
     */
    public function setIdiconeCls($data)
    {
        $this->_IdiconeCls = $data;
        return $this;
    }

    /**
     * Gets column idiconeCls
     *
     * @return string
     */
    public function getIdiconeCls()
    {
        return $this->_IdiconeCls;
    }

    /**
     * Sets column LabelICone
     *
     * @param string $data
     * @return Application_Model_Iconecls
     */
    public function setLabelICone($data)
    {
        $this->_LabelICone = $data;
        return $this;
    }

    /**
     * Gets column LabelICone
     *
     * @return string
     */
    public function getLabelICone()
    {
        return $this->_LabelICone;
    }

    /**
     * Sets column urlimage
     *
     * @param text $data
     * @return Application_Model_Iconecls
     */
    public function setUrlimage($data)
    {
        $this->_Urlimage = $data;
        return $this;
    }

    /**
     * Gets column urlimage
     *
     * @return text
     */
    public function getUrlimage()
    {
        return $this->_Urlimage;
    }

    /**
     * Sets dependent relations fk_actionsapplication_iconeCls1
     *
     * @param array $data An array of Application_Model_Actionsapplication
     * @return Application_Model_Iconecls
     */
    public function setActionsapplication(array $data)
    {
        $this->_Actionsapplication = array();

        foreach ($data as $object) {
            $this->addActionsapplication($object);
        }

        return $this;
    }

    /**
     * Sets dependent relations fk_actionsapplication_iconeCls1
     *
     * @param Application_Model_Actionsapplication $data
     * @return Application_Model_Iconecls
     */
    public function addActionsapplication(Application_Model_Actionsapplication $data)
    {
        $this->_Actionsapplication[] = $data;
        return $this;
    }

    /**
     * Gets dependent fk_actionsapplication_iconeCls1
     *
     * @param boolean $load Load the object if it is not already
     * @return array The array of Application_Model_Actionsapplication
     */
    public function getActionsapplication($load = true)
    {
        if ($this->_Actionsapplication === null && $load) {
            $this->getMapper()->loadRelated('FkActionsapplicationIconeCls1', $this);
        }

        return $this->_Actionsapplication;
    }

    /**
     * Sets dependent relations fk_services_iconeCls1
     *
     * @param array $data An array of Application_Model_Services
     * @return Application_Model_Iconecls
     */
    public function setServices(array $data)
    {
        $this->_Services = array();

        foreach ($data as $object) {
            $this->addServices($object);
        }

        return $this;
    }

    /**
     * Sets dependent relations fk_services_iconeCls1
     *
     * @param Application_Model_Services $data
     * @return Application_Model_Iconecls
     */
    public function addServices(Application_Model_Services $data)
    {
        $this->_Services[] = $data;
        return $this;
    }

    /**
     * Gets dependent fk_services_iconeCls1
     *
     * @param boolean $load Load the object if it is not already
     * @return array The array of Application_Model_Services
     */
    public function getServices($load = true)
    {
        if ($this->_Services === null && $load) {
            $this->getMapper()->loadRelated('FkServicesIconeCls1', $this);
        }

        return $this->_Services;
    }

    /**
     * Returns the mapper class for this model
     *
     * @return Application_Model_Mapper_Iconecls
     */
    public function getMapper()
    {
        if ($this->_mapper === null) {
            $this->setMapper(new Application_Model_Mapper_Iconecls());
        }

        return $this->_mapper;
    }

    /**
     * Deletes current row by deleting the row that matches the primary key
     *
	 * @see Application_Model_Mapper_Iconecls::delete
     * @return int|boolean Number of rows deleted or boolean if doing soft delete
     */
    public function deleteRowByPrimaryKey()
    {
        if ($this->getIdiconeCls() === null) {
            throw new Exception('Primary Key does not contain a value');
        }

        return $this->getMapper()
                    ->getDbTable()
                    ->delete('idiconeCls = ' .
                             $this->getMapper()
                                  ->getDbTable()
                                  ->getAdapter()
                                  ->quote($this->getIdiconeCls()));
    }
}
